package doing.normal_001_100;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * 12. Integer to Roman 转换罗马数字
 * <p>
 * Symbol       Value
 * I             1
 * V             5
 * X             10
 * L             50
 * C             100
 * D             500
 * M             1000
 * <p>
 * 示例 4:
 * <p>
 * 输入: 58
 * 输出: "LVIII"
 * 解释: L = 50, V = 5, III = 3.
 * <p>
 * 示例 5:
 * <p>
 * 输入: 1994
 * 输出: "MCMXCIV"
 * 解释: M = 1000, CM = 900, XC = 90, IV = 4.
 *
 * @author 大硕
 * 2019-03-21 10:59 PM
 **/
@Slf4j
public class IntegerToRoman {

    @SuppressWarnings("all")
    public String intToRoman(int num) {
        String result = "";
        //TODO
        return result;
    }

    @Test
    public void test() {
        log.info("result:{}", intToRoman(1994));
    }
}



























/*
public String intToRoman(int num) {
    String result = "";
    int[] val = new int[]{1000, 900, 500, 400, 100, 90,
                          50, 40, 10, 9,
                          5, 4, 1};

    String[] str = new String[]{"M", "CM", "D", "CD", "C", "XC",
                                "L", "XL", "X", "IX",
                                "V", "IV", "I"};

    for (int i = 0; i < val.length; ++i) {
        while (num >= val[i]) {
            num = num - val[i];
            result = result + str[i];
        }
    }
    return result;
}
*/
